﻿using DocumentFormat.OpenXml.Lite.DrawingML.Types;
using DocumentFormat.OpenXml.Lite.Xml;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Schema;
using System.Xml.Serialization;

namespace DocumentFormat.OpenXml.Lite.DrawingML.Chart.Elements
{
    [XmlRoot("dispUnits", Namespace = Constants.Chart)]
    public class DisplayUnits : XmlSerializable
    {
        [XmlElement("", Namespace = Constants.Chart)]
        public IDisplayUnit DisplayUnit { get; set; }

        [Optional]
        [XmlElement("dispUnitsLbl", Namespace = Constants.Chart)]
        public DisplayUnitsLabel Label { get; set; }

        [Optional]
        [XmlElement("extLst", Namespace = Constants.Chart)]
        public ExtensionList ExtensionList { get; set; }

        public DisplayUnits() { }
    }

    [XmlRoot("custUnit", Namespace = Constants.Chart)]
    public class CustomDisplayUnit : XmlSerializable, IDisplayUnit
    {
        [XmlAttribute("val", Form = XmlSchemaForm.Qualified)]
        public double Value { get; set; }

        public CustomDisplayUnit() { }
    }

    [XmlRoot("builtInUnit", Namespace = Constants.Chart)]
    public class BuiltInDisplayUnit : XmlSerializable, IDisplayUnit
    {
        [Optional]
        [XmlAttribute("val", Form = XmlSchemaForm.Qualified)]
        public Nullable<ST_BuiltInUnit> Value { get; set; }

        public BuiltInDisplayUnit() { }
    }
}
